SftTree/OCX 7.0

Fixed / Variable Height Items

Softel vdm, Inc.

There are two methods by which a tree control determines the height of an item.  Based on the property Items.Style, a variable height or fixed height tree control is created.

Fixed Height Tree Control

In a fixed height tree control, each item has the same height.  SftTree/OCX determines the best item height for all items by analyzing the default font height (Font property), the number of text lines (Items.Lines), the cell graphic height (Cell.Image), 3D display mode (Items.Cell3D), label graphic height (Item.LabelImage), the plus/minus graphic height (Items.PlusMinusImageExpandable), the expand/collapse button graphic height (ButtonAppearance), the tree line style (Items.TreeLineStyle), the item graphic height (Item.Image), grid line style (Items.GridStyle), the row header font (RowHeaders.Font), the row header picture height (RowHeader.Image) and the number of text lines (RowHeaders.Lines).  If a component is not used, it is not considered to determine the best height.

Cell fonts (Cell.Font) are not considered.  If a cell font is used in a fixed height tree control, the application must insure that the cell font is not larger than the default font.

All row header graphics must be the same height and width (RowHeader.Image).

All label graphics must be the same height and width (Item.LabelImage).

All item graphics must be the same height and width (Item.Image).

All cell graphics in all columns must be the same height and width (Cell.Image).

An application can override the item height using the Items.MinHeightPix and Items.MaxHeightPix properties.

Variable Height Tree Control

In a variable height tree control, items have varying heights. Each item's height is individually recalculated as attributes change.  This places an additional performance constraint on the tree control, so a variable height tree control should only be used when variable height items are necessary.

SftTree/OCX determines the best item height for each item by analyzing the default font height (Font property), the cell font (Cell.Font) and cell graphic height (Cell.Image) for each column, the number of text lines (Items.Lines) and word wrap style for each cell (Column.CellMultiline and Column.CellWordWrap), 3D display mode (Items.Cell3D), the item's label graphic height (Item.LabelImage), the plus/minus graphic height (Items.PlusMinusImageExpandable), the expand/collapse button graphic height (ButtonAppearance), the tree line style (Items.TreeLineStyle), the item's item graphic height (Item.Image), grid line style (Items.GridStyle), the row header font (RowHeaders.Font), the item's row header picture height (RowHeader.Image) and the maximum number of text lines (RowHeaders.Lines).  If a component is not used, it is not considered to determine the best height. 

An application can override the item height using the Item.MinHeightPix and Item.MaxHeightPix properties.


Feedback / comments / error reports for this topic
© 2015 - Softel vdm, Inc. - www.softelvdm.com